﻿using DFGK_WMS.Model.Dto;
using DFGK_WMS.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK.IService
{
    public interface ICellService
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool AddCell(Cell obj, out string message);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool AddCell(IEnumerable<Cell> obj);

        /// <summary>
        /// 仓位左侧树形显示
        /// </summary>
        /// <returns></returns>
        List<Menuitem> GetMenuitem();

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdCell(Cell obj, out string message);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        bool DelCell(long id);

        /// <summary>
        /// 根据id获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Cell? GetCellById(long id);
    
        /// <summary>
        /// 列表显示
        /// </summary>
        /// <param name="logicalPartCode"></param>
        /// <param name="fullStatus"></param>
        /// <param name="status"></param>
        /// <param name="cname"></param>
        /// <param name="whid"></param>
        /// <param name="areid"></param>
        /// <param name="sheid"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<Cell> GetCellList(string? logicalPartCode, int fullStatus, int status, string? cname, long whid, long areid, long sheid, int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// 获取全部
        /// </summary>
        /// <returns></returns>
        List<Cell> GetAllCellList();

        /// <summary>
        /// 批量添加仓位
        /// </summary>
        /// <param name="cellCreateBodyDTO"></param>
        /// <returns></returns>
        bool BatchCreateCell(CellCreateBodyDTO cellCreateBodyDTO, out string message);

        /// <summary>
        /// 仓位统计
        /// </summary>
        /// <returns></returns>
        CellStatisticsDto GetCellCount();

        /// <summary>
        /// 获取同库区的仓位
        /// </summary>
        /// <param name="arecode"></param>
        /// <returns></returns>
        List<Cell> GetTransferBinToCellList(string arecode);

        /// <summary>
        /// 根据编码获取对象
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Cell? GetCellByCode(string code);
        /// <summary>
        /// 获取仓位的ErpCode
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        string GetErpCodeByCode(string code);

        /// <summary>
        /// 获取仓位的ErpCode
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        List<string> GetErpCodeByCodeList(string[] code);

        List<dynamic> GetCellByLayers(params int[] layers);

        List<Cell> GetCellByLayer(int layer);
    }
}
